﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SharpHomeEngine
{
    public class Request4TagState : Request4Tag
    {


        public Request4TagState(Controller Controller, Tag Tag)
            : base(Controller, Tag)
        {

        }

        public void Complete(object Value, bool Completed, bool Sucessful)
        {
            objValue = Value;
            if (objValue != this.Value)
            {
                Engine.RaiseChangeTagState(this.DeviceInterface, this.Device, this.Tag, this.Value);
            }
            this.Complete(Completed, Sucessful);
        }
 
        public override void Complete(bool Completed, bool Sucessful)
        {
            Engine.RaiseStateGetCompletedEvent(this);
            base.Complete(Completed, Sucessful);       
        }
    }
}
